const adminModel = require('../model/adminModel')

const adminControl = {}

adminControl.putUser = async (req, res) => {
  const user = {
    name: req.body.name,
    pwd: req.body.pwd
  }
  await adminModel.addAdministrator(user).then(row => {
    res.json({
      code: 200,
      data: row
    })
  }).catch(err => {
    res.json({
      code: 100,
      data: err
    })
  })
}

module.exports = adminControl
